//
//  EasyFrame.swift
//  Mars
//
//  Created by 纪洪波 on 16/4/12.
//  Copyright © 2016年 曾琦. All rights reserved.
//

import UIKit

public let KscreenHeight = UIScreen.main.bounds.height
public let KscreenWidht = UIScreen.main.bounds.width

extension UIView {
    public var x: CGFloat {
        get {
            return self.frame.origin.x
        }
        set {
            var frame = self.frame;
            frame.origin.x = newValue;
            self.frame = frame;
        }
    }

    public var y: CGFloat {
        get {
            return self.frame.origin.y
        }
        set {
            var frame = self.frame;
            frame.origin.y = newValue;
            self.frame = frame;
        }
    }
    
    public var width: CGFloat {
        get {
            return self.frame.size.width
        }
        set {
            var frame = self.frame;
            frame.size.width = newValue;
            self.frame = frame;
        }
    }
    
    public var height: CGFloat {
        get {
            return self.frame.size.height
        }
        set {
            var frame = self.frame;
            frame.size.height = newValue;
            self.frame = frame;
        }
    }
    
    public var size: CGSize {
        get {
            return self.frame.size
        }
        set {
            var frame = self.frame;
            frame.size = newValue;
            self.frame = frame;
        }
    }
}
